home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWCommon / Include / FWEnvDef.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  8.6 KB  |  365 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWEnvDef.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWENVDEF_H
  11. #define FWENVDEF_H
  12.  
  13. //========================================================================================
  14. // Definitions Specific to the Build Configuration
  15. //========================================================================================
  16.  
  17. #ifndef FWBLDDEF_H
  18. #include "FWBldDef.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. // Wrappers for C
  23. //========================================================================================
  24.  
  25. #ifdef __cplusplus
  26.  
  27.     // C++ compilation
  28.     
  29. #define FW_EXTERN_C_BEGIN    \
  30.     extern "C" \
  31.     {
  32. #define FW_EXTERN_C_END        \
  33.     }
  34.     
  35. #else
  36.  
  37.     // Good 'ol C compilation
  38.  
  39. #define FW_EXTERN_C_BEGIN
  40. #define FW_EXTERN_C_END
  41.  
  42. #endif
  43.  
  44. //========================================================================================
  45. // Metrowerks -- Macintosh
  46. //========================================================================================
  47.  
  48. #ifdef __MWERKS__
  49.  
  50.     #ifndef FW_BUILD_MAC
  51.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  52.     #endif
  53. //    #define FW_BUILD_MAC
  54. //    #undef FW_BUILD_WIN
  55. //    #undef FW_BUILD_WIN16
  56. //    #undef FW_BUILD_WIN32
  57. //    #undef FW_BUILD_WIN32S
  58.     
  59.     #if 0x0800 <= __MWERKS__
  60.     #    if __option(exceptions)
  61.     #        define FW_NATIVE_EXCEPTIONS
  62.     #    endif
  63.     #    if __option(RTTI)
  64.     #        define FW_COMPILER_SUPPORTS_RTTI
  65.     #    endif
  66.     #endif
  67.     
  68.     #ifdef FW_BUILD_MAC68K
  69.         #ifndef FW_ODFLIB
  70.         #define FW_ODFLIB_IMPORT
  71.         #endif
  72.     #endif
  73.     
  74.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  75.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  76.     #endif
  77.     
  78.     #define ppcinterfaces 1
  79.     
  80.     #ifndef OLDROUTINENAMES
  81.     #define OLDROUTINENAMES         0
  82.     #endif
  83.     
  84.     #ifndef OLDROUTINELOCATIONS
  85.     #define OLDROUTINELOCATIONS     0
  86.     #endif
  87.     
  88.     // Hack to control what is exported from a CFM shared lib on PPC. Define functions
  89.     // with indicative names which CodeWarrior will place in the .exp file. The MPW tool
  90.     // MWExportTool will then filter the .exp removing exports between off functions and
  91.     // on functions, inclusive. The functions are dead-stripped since they are not exported
  92.     // and never referenced.
  93.     
  94.     #define FW_EXPORT_ON(file, id) \
  95.         extern "C" void _FW_export_lib_on_##file##id(); \
  96.         extern "C" void _FW_export_lib_on_##file##id() { }
  97.     #define FW_EXPORT_OFF(file, id) \
  98.         extern "C" void _FW_export_lib_off_##file##id(); \
  99.         extern "C" void _FW_export_lib_off_##file##id() { }
  100.     
  101.     #define FW_FOUR_BYTE_INTS __fourbyteints__
  102.  
  103.     // Force PowerPC alignment
  104.     #pragma options align=power
  105.  
  106. //========================================================================================
  107. // Symantec C++ -- Macintosh
  108. //========================================================================================
  109. #elif defined SYMANTEC_CPLUS && !defined _WINDOWS
  110.     
  111.     #pragma options(system_includes_from_project_tree)
  112.     
  113.     #define FW_AGGRESSIVE_PRECOMPILE 1
  114.         
  115. //    #ifndef FW_USE_TEMPLATE_PRAGMAS
  116. //    #define FW_USE_TEMPLATE_PRAGMAS 1
  117. //    #endif
  118.     
  119.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  120.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  121.     #endif
  122.  
  123.     #define PRAGMA_LIB_EXPORT 1
  124.     #define PRAGMA_IMPORT 1
  125.     
  126.     #ifndef SOMLINK
  127.     #define SOMLINK
  128.     #endif
  129.     
  130.     #ifndef SOMDLINK
  131.     #define SOMDLINK
  132.     #endif
  133.     
  134.     #ifndef FW_BUILD_MAC
  135.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  136.     #endif
  137. //    #define FW_BUILD_MAC
  138. //    #undef FW_BUILD_WIN
  139. //    #undef FW_BUILD_WIN16
  140. //    #undef FW_BUILD_WIN32
  141. //    #undef FW_BUILD_WIN32S
  142.     
  143.     #define ppcinterfaces 1
  144.     
  145.     #ifndef OLDROUTINENAMES
  146.     #define OLDROUTINENAMES         0
  147.     #endif
  148.     
  149.     #ifndef OLDROUTINELOCATIONS
  150.     #define OLDROUTINELOCATIONS     0
  151.     #endif
  152.     
  153.     #define FW_EXPORT_ON
  154.     #define FW_EXPORT_OFF
  155.     
  156.     #ifndef FW_FOUR_BYTE_INTS
  157.     #define FW_FOUR_BYTE_INTS __option(int_4)
  158.     #endif
  159.  
  160.     // Force PowerPC alignment
  161.     #pragma options align=power
  162.  
  163. //========================================================================================
  164. // CFM 68K using Symantec SCpp (__SC__ would also catch SPM but that's listed above)
  165. //========================================================================================
  166. #elif defined __SC__ && !defined _WINDOWS
  167.     
  168.     #define FW_AGGRESSIVE_PRECOMPILE 1
  169.  
  170. //    #ifndef FW_USE_TEMPLATE_PRAGMAS
  171. //    #define FW_USE_TEMPLATE_PRAGMAS 1
  172. //    #endif
  173.     
  174.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  175.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  176.     #endif
  177.  
  178.     // We want clients of the ODF library to turn on
  179.     // the import pragmas.  Define FW_ODFLIB only when building
  180.     // the ODF shared library. -  [sfu]
  181.     
  182.     #ifndef FW_ODFLIB
  183.     #define FW_ODFLIB_IMPORT
  184.     #endif
  185.         
  186.     #ifndef SOMLINK
  187.     #define SOMLINK
  188.     #endif
  189.     
  190.     #ifndef SOMDLINK
  191.     #define SOMDLINK
  192.     #endif
  193.     
  194.     #ifndef FW_BUILD_MAC
  195.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  196.     #endif
  197. //    #define FW_BUILD_MAC
  198. //    #undef FW_BUILD_WIN
  199. //    #undef FW_BUILD_WIN16
  200. //    #undef FW_BUILD_WIN32
  201. //    #undef FW_BUILD_WIN32S
  202.     
  203.     #define ppcinterfaces 1
  204.  
  205.     #ifndef OLDROUTINENAMES
  206.     #define OLDROUTINENAMES         0
  207.     #endif
  208.     
  209.     #ifndef OLDROUTINELOCATIONS
  210.     #define OLDROUTINELOCATIONS     0
  211.     #endif
  212.     
  213.     #define FW_EXPORT_ON
  214.     #define FW_EXPORT_OFF
  215.     
  216.     #ifndef FW_FOUR_BYTE_INTS
  217.     #define FW_FOUR_BYTE_INTS __option(int_4)
  218.     #endif
  219.     
  220. //========================================================================================
  221. // Mr. C -- Macintosh
  222. //========================================================================================
  223. #elif defined __MRC__
  224.  
  225.     #ifndef FW_USE_TEMPLATE_PRAGMAS
  226.     #define FW_USE_TEMPLATE_PRAGMAS 1
  227.     #endif
  228.     
  229.     // We want clients of the ODF library to turn on
  230.     // the import pragmas.  Define FW_ODFLIB only when building
  231.     // the ODF shared library. -  [sfu]
  232.     
  233.     #ifndef FW_ODFLIB
  234.     #define FW_ODFLIB_IMPORT
  235.     #endif
  236.     
  237.     #ifndef FW_BUILD_MAC
  238.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  239.     #endif
  240. //    #define FW_BUILD_MAC
  241. //    #undef FW_BUILD_WIN
  242. //    #undef FW_BUILD_WIN16
  243. //    #undef FW_BUILD_WIN32
  244. //    #undef FW_BUILD_WIN32S
  245.     
  246.     #define ppcinterfaces 1
  247.  
  248.     #ifndef OLDROUTINENAMES
  249.     #define OLDROUTINENAMES         0
  250.     #endif
  251.     
  252.     #ifndef OLDROUTINELOCATIONS
  253.     #define OLDROUTINELOCATIONS     0
  254.     #endif
  255.  
  256.     #define FW_EXPORT_ON
  257.     #define FW_EXPORT_OFF
  258.     
  259.     #define FW_FOUR_BYTE_INTS 1
  260.  
  261.     // Force PowerPC alignment
  262.     #pragma options align=power
  263.  
  264. //========================================================================================
  265. // Microsoft Visual C++ - Windows
  266. //========================================================================================
  267. #elif defined _MSC_VER
  268.  
  269.     #ifdef _WINDOWS_
  270.     #error Include FWEnvDef.h before including Windows.h
  271.     #endif
  272.  
  273.     #define FW_BUILD_WIN
  274.     #define FW_BUILD_WIN32
  275.     #define FW_HAS_INSTANCE_DATA
  276.     #define FW_NATIVE_EXCEPTIONS
  277.  
  278.     #define FW_FOUR_BYTE_INTS            1
  279.     #define FW_USE_PRECOMPILED_HEADERS    1
  280.     
  281.     #ifdef _DEBUG
  282.     #define    FW_DEBUG
  283.     #endif
  284.  
  285.     #define PLATFORM_WINDOWS            1
  286.  
  287.     #define STRICT
  288.     #define WIN32_LEAN_AND_MEAN
  289.     #define WIN32_EXTRA_LEAN
  290.     #include <windows.h>
  291.  
  292.     #pragma warning(disable:4080)        // Invalid name in segment pragma
  293.     #pragma warning(disable:4660)        // Template specialization already instantiated
  294.  
  295. //========================================================================================
  296. // Symantec C++ - Windows
  297. //========================================================================================
  298. #elif defined __SC__ && defined _WINDOWS
  299.  
  300.     #ifdef _WINDOWS_
  301.     #error Include FWEnvDef.h before including Windows.h
  302.     #endif
  303.  
  304.     #define FW_BUILD_WIN
  305.     #define FW_BUILD_WIN32
  306.     #define FW_HAS_INSTANCE_DATA
  307.     #define FW_NATIVE_EXCEPTIONS
  308.  
  309.     #define FW_FOUR_BYTE_INTS            1
  310.     #define FW_AGGRESIVE_PRECOMPILE        1
  311.  
  312.     #ifdef _DEBUG
  313.     #define    FW_DEBUG
  314.     #endif
  315.  
  316.     #define PLATFORM_WINDOWS            1
  317.  
  318.     #define STRICT
  319.     #include <windows.h>
  320.     
  321.     #define SOMLINK __stdcall
  322.     #define SOMDLINK __stdcall
  323.  
  324. //========================================================================================
  325. // Unsupported Compiler
  326. //========================================================================================
  327. #else
  328.  
  329.     #error Unsupported compiler
  330.  
  331. #endif
  332.  
  333. //========================================================================================
  334. // Other Defines 
  335. //========================================================================================
  336.  
  337. #ifdef FW_BUILD_MAC
  338.     #ifndef _PLATFORM_MACINTOSH_
  339.         #define _PLATFORM_MACINTOSH_         1
  340.     #endif
  341.     #ifndef PLATFORM_MACINTOSH
  342.         #define PLATFORM_MACINTOSH             1
  343.     #endif
  344.     #if !defined(FW_HAS_INSTANCE_DATA)
  345.         #define FW_HAS_INSTANCE_DATA
  346.     #endif
  347.     
  348.     #ifdef FW_NATIVE_EXCEPTIONS
  349.     #    define _NATIVE_EXCEPTIONS_
  350.     #endif
  351.     
  352.     #define FW_EXPORT
  353. #endif
  354.  
  355. #ifdef FW_BUILD_WIN
  356.     #ifndef PLATFORM_WINDOWS
  357.         #define PLATFORM_WINDOWS             1
  358.     #endif
  359.     
  360.     #define FW_EXPORT                        __declspec(dllexport)
  361.     
  362. #endif
  363.  
  364. #endif
  365.